from urllib import request,error
import re


url = "https://su.58.com/gongyeyuan/chuzu/?PGTID=0d3090a7-0000-5cb9-f5c4-b1d4e2526d15&ClickID=2"
req = request.Request(url)

res = request.urlopen(req)

html = res.read().decode("utf-8")
#print(html)

pat = 'lazy_src="//(.*?)?w=294&h=220&crop=1.*?<a.*? >(.*?)</a>.*?<p class="room strongbox">(.*?)(&nbsp;){4}(.*?)</p>.*?<b class="strongbox">(.*?)</b>元/月'

dlist = re.findall(pat,html,re.S)

#print(dlist)
for v in dlist:
    print(v[1].strip() + " | " + v[0] + " | " + v[2].strip() + "," + v[4] + " | " + v[5]+"元")

